<%@ include file="/common.jsp" %>
<html>
<head>
    <meta charset="UTF-8">
    <%@ page contentType="text/html; charset=UTF-8" %>
    <title>管理员后台</title>
    <style>
        body {
            display: flex;
            height: 100vh;
        }
        .sidebar {
            width: 250px;
            background-color: #f8f9fa;
            border-right: 1px solid #dee2e6;
            padding-top: 10px;
        }
        .sidebar .nav-link {
            color: #000;
        }
        .sidebar .nav-link:hover {
            background-color: #e9ecef;
            color: #007bff;
        }
        .main-content {
            flex-grow: 1;
            padding: 20px;
            overflow: auto;
        }
    </style>
    <script>
        $(document).ready(function(){
            $('.nav-link').click(function(e){
                if ($(this).attr('id') === 'logout-link') {
                    window.location.href = $(this).attr('href');
                } else {
                    e.preventDefault();
                    var url = $(this).attr('href');
                    $('.main-content').load(url);
                }
            });
        });
    </script>
</head>
<body>
<div class="sidebar">
    <nav class="nav flex-column">
        <h4 class="text-center mt-3">管理员菜单</h4>
        <a class="nav-link" href="<%= contextPath %>/views/admin/company.jsp"><i class="fas fa-building"></i> 公司管理</a>
        <a class="nav-link" href="<%= contextPath %>/views/admin/department.jsp"><i class="fas fa-sitemap"></i> 部门管理</a>
        <a class="nav-link" href="<%= contextPath %>/views/admin/employee.jsp"><i class="fas fa-user"></i> 员工管理</a>
        <a class="nav-link" href="<%= contextPath %>/views/admin/warehouse.jsp"><i class="fas fa-warehouse"></i> 仓库管理</a>
        <a class="nav-link" href="<%= contextPath %>/views/admin/item.jsp"><i class="fas fa-box"></i> 物品管理</a>
        <a class="nav-link" href="<%= contextPath %>/views/admin/qualifiedProduct.jsp"><i class="fas fa-check-circle"></i> 合格产品管理</a>
        <a class="nav-link" href="<%= contextPath %>/views/admin/defectiveProduct.jsp"><i class="fas fa-times-circle"></i> 次品管理</a>
        <a class="nav-link" href="<%= contextPath %>/views/admin/supplier.jsp"><i class="fas fa-truck"></i> 供应商管理</a>
        <a class="nav-link" href="<%= contextPath %>/views/admin/receiver.jsp"><i class="fas fa-receipt"></i> 接收方管理</a>
        <a class="nav-link" href="<%= contextPath %>/views/admin/operator.jsp"><i class="fas fa-cogs"></i> 操作员管理</a>
        <a class="nav-link" href="<%= contextPath %>/views/admin/managergg.jsp"><i class="fas fa-user-tie"></i> 经理管理</a>
    </nav>
    <nav class="nav flex-column mt-auto">
        <a class="nav-link" id="logout-link" href="<%= contextPath %>/"><i class="fas fa-sign-out-alt"></i> 退出</a>
    </nav>
</div>
<div class="main-content">
    <!-- 这里是主要内容区域 -->
</div>
</body>
</html>
